package com.study.netty.server.controller;

import com.study.netty.server.handle.ServerInboundHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName TestController
 * @Description TODO
 * @Author csc
 * @Date 2023/5/16 10:52
 * @Version 1.0
 */

@Slf4j
@RestController
public class TestController {


    @Autowired
    private ServerInboundHandler serverInboundHandler;



    @PostMapping("/sendMsg")
    public void write(@RequestParam String message) {
        log.info("收到写入命令"+message);
        serverInboundHandler.channelWrite(null, message);
    }


}
